using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Cards")]
	[Serializable]
    public class Card : DBO<Card>
    {
		#region Fields
		
		private int? _IdCard;
		private int? _IdMatch;
		private int? _IdClub;
		private int? _IdPlayer;
		private string _CardType;
		private string _Minute;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Card()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdCard 
		/// </summary>
		/// <param name="IdCard">The IdCard</param>
		public Card(int? IdCard )
		{
			this.IdCard = IdCard;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdCard">Sets int? value for IdCard</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="IdClub">Sets int? value for IdClub</param>
		/// <param name="IdPlayer">Sets int? value for IdPlayer</param>
		/// <param name="CardType">Sets string value for CardType</param>
		/// <param name="Minute">Sets string value for Minute</param>
		public Card(int? idCard, int? idMatch, int? idClub, int? idPlayer, string cardType, string minute)
		{
			this.IdCard = idCard;
			this.IdMatch = idMatch;
			this.IdClub = idClub;
			this.IdPlayer = idPlayer;
			this.CardType = cardType;
			this.Minute = minute;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdCard
		/// </summary>
		[ColumnAttribute("IdCard", SqlDbType.Int , 4 , true, true, false)]
		public int? IdCard
		{
			set
			{
				this._IdCard = value;
			}
			get
			{
				return this._IdCard;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdClub
		/// </summary>
		[ColumnAttribute("IdClub", SqlDbType.Int , 4 , false, false, true)]
		public int? IdClub
		{
			set
			{
				this._IdClub = value;
			}
			get
			{
				return this._IdClub;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdPlayer
		/// </summary>
		[ColumnAttribute("IdPlayer", SqlDbType.Int , 4 , false, false, true)]
		public int? IdPlayer
		{
			set
			{
				this._IdPlayer = value;
			}
			get
			{
				return this._IdPlayer;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for CardType
		/// </summary>
		[ColumnAttribute("CardType", SqlDbType.NVarChar , 50 , false, false, true)]
		public string CardType
		{
			set
			{
				this._CardType = value;
			}
			get
			{
				return this._CardType;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for Minute
		/// </summary>
		[ColumnAttribute("Minute", SqlDbType.NVarChar , 50 , false, false, true)]
		public string Minute
		{
			set
			{
				this._Minute = value;
			}
			get
			{
				return this._Minute;
			}
		}
		
		
		/// <summary>
		/// Get a Club of current Card object base on IdClub
		/// </summary>
		public Club Club
		{
			get
			{
				if (this.IdClub == null)
					return null;
	
				Club condition = new Club(this.IdClub);
				return ClubController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Match of current Card object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Player of current Card object base on IdPlayer
		/// </summary>
		public Player Player
		{
			get
			{
				if (this.IdPlayer == null)
					return null;
	
				Player condition = new Player(this.IdPlayer);
				return PlayerController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdCard]
            /// </summary>
            public string IdCard
            {
                get
                {
                    return "IdCard";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [IdClub]
            /// </summary>
            public string IdClub
            {
                get
                {
                    return "IdClub";
                }
            }
            /// <summary>
            /// Get the name of column [IdPlayer]
            /// </summary>
            public string IdPlayer
            {
                get
                {
                    return "IdPlayer";
                }
            }
            /// <summary>
            /// Get the name of column [CardType]
            /// </summary>
            public string CardType
            {
                get
                {
                    return "CardType";
                }
            }
            /// <summary>
            /// Get the name of column [Minute]
            /// </summary>
            public string Minute
            {
                get
                {
                    return "Minute";
                }
            }
        }
        #endregion
    }
}
